<script>
	export default {
		mapkey: "fad2d687dbc47bedc02aa3ce8f3d1542",
		mapwebkey: "f2ede9a22d5f97e0e2eeb8a03338d733",
		globalData: {},
		onLaunch: function(options) {
			let _this = this
			_this.checkForUpdate()
			
			wx.setStorageSync("is_openScreen", true)
			// 判断是否是分享进入的
			console.log("页面打开方式" + options.scene)
			if (options.scene == 1007 || options.scene == 1001 || options.scene == 1008 || options.scene == 1155 ||
				options.scene == 59 || options.scene == 1037 || options.scene == 1047) {
				_this.globalData.share = true
				wx.setStorageSync("share", false)
			} else {
				console.log(111)
				_this.globalData.share = false
			};
			uni.showShareMenu({
			        withShareTicket:true,
			        //设置下方的Menus菜单，才能够让发送给朋友与分享到朋友圈两个按钮可以点击
			        menus:["shareAppMessage","shareTimeline"]
			    })
			let menuButton = wx.getMenuButtonBoundingClientRect();
			wx.getSystemInfo({
				success: res => {
					// 状态栏高度
					_this.globalData.statusBarHeight = res.statusBarHeight
					//胶囊按钮与顶部的距离
					_this.globalData.navTop = res.statusBarHeight
					//导航总高度 状态栏高度+胶囊高度 +（胶囊距离上边界坐标-状态栏高度）*2
					_this.globalData.navHeight = res.statusBarHeight + menuButton.height + (menuButton.top - res.statusBarHeight) * 2;
					// 导航栏内容使用区域高度
					_this.globalData.useHeight = menuButton.height + (menuButton.top - res.statusBarHeight) * 2;
					// 可使用窗口高度
					_this.globalData.windowHeight = res.windowHeight;
					// 胶囊按钮高度
					_this.globalData.ButtonHeight = menuButton.height;
					// 胶囊按钮距离左边宽度
					_this.globalData.ButtonLeft = menuButton.left;
					// 胶囊按钮距离右边宽度
					_this.globalData.ButtonRight = menuButton.right;
					// 文字区域pannding-left
					_this.globalData.textPaddingLift = wx.getSystemInfoSync().windowWidth - menuButton.left;
					_this.globalData.menuH = wx.getMenuButtonBoundingClientRect().height;
					_this.globalData.menuT = wx.getMenuButtonBoundingClientRect().top;
				},
				fail(err) {
					console.log(err);
				}
			})
		},
		onShow: function() {},
		onHide: function() {},
		methods: {
			// 更新
			checkForUpdate: function() {
				const updateManager = wx.getUpdateManager()
				updateManager.onUpdateReady(function() {
					wx.showModal({
						title: '更新提示',
						content: '新版本已经准备好，是否重启应用？',
						success: function(res) {
							if (res.confirm) {
								updateManager.applyUpdate()
							}
						}
					})
				})
				updateManager.onUpdateFailed(function() {})
			},
		}
	}
</script>

<style lang="scss">
	@import "uview-ui/index.scss";
	@import 'static/icon/iconfont.css';
	@import 'static/icon/icons.css';
	@import 'static/css/common.css';

	view,
	text,
	input {
		box-sizing: border-box;
		word-break: break-all;
	}

	img {
		max-width: 100%;
		height: auto;
	}

	/*实名标签*/
	.shiming {
		width: 30rpx;
		height: 30rpx;
		border-radius: 3rpx;
		background: #FFA811;
		text-align: center;
		line-height: 30rpx;
		color: #fff;
		font-size: 20rpx;
		margin-left: 12rpx;
	}

	/*企业标签*/
	.qiye {
		width: 30rpx;
		height: 30rpx;
		border-radius: 3rpx;
		background: #11B9FF;
		text-align: center;
		line-height: 30rpx;
		color: #fff;
		font-size: 20rpx;
		margin-left: 6rpx;
	}

	/*一排省略号*/
	.clamp1 {
		overflow: hidden;
		white-space: nowrap;
		text-overflow: ellipsis;
	}

	/*两排省略号*/
	.clamp2 {
		display: -webkit-box;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 2;
		overflow: hidden;
	}

	::-webkit-scrollbar {
		display: none
	}

	.uParse {
		padding: 0 30rpx;
	}
</style>
